<template>
<div class="addedItem">
  <div class="item"  v-for="(item, key) in list" :key="key">

    <div class="title" :style="{ backgroundImage: 'url(' + item.bg + ')' }">
      <div class="title_txt">
        <div class="txt_box">
          <div class="icon">
            <img :src="item.icons" alt="" srcset="" />
          </div>
          <div class="txt">{{ item.title }}</div>
        </div>
        <div class="date">
          预约日期：2022.01.01
        </div>
      </div>

    </div>
    <div class="content">
      <div class="item_box" >
        <div class="img_box">
          <van-image width="220rpx" height="220rpx"  src="https://img.yzcdn.cn/vant/cat.jpeg" />
        </div>
        <div class="r">
          <div class="title">
            五粮液 52度普五 第八代款 浓香型白酒 100ml商 100ml商务. 100ml商务. 100ml商务. </div>
          <div class="bottom">
            <div class="now_price">
              <span>￥</span>
              <div class="num">{{9500/100}}</div>
              <div class="icon_img_box">
                <van-image width="74rpx" height="25rpx" :src="pirce_spe_src" />
              </div>
            </div>
            <div class="market_price">市场价￥{{19900/100}}</div>
          </div>
        </div>

        <van-icon class="icon_plus" name="add" />
      </div>
    </div>
  </div>
</div>
</template>

<script>
export default {
  props: {
    list: {
      type: Array
    },
  },
  data(){
    return {

      pirce_spe_src: require("../../styles/images/famousWine/pirce_spe.png"),
    }

  },
  onLoad() {
    console.log('this.list', this.list)
    this.list.map((item, val) => {
      let bg_w;
      val++
      if (val % 4 == 0) {
        bg_w = 4
      } else if (val % 3 == 0) {
        bg_w = 3
      } else if (val % 2 == 0) {
        bg_w = 2
      } else if (val % 1 == 0) {
        bg_w = 1
      }
      item.bg = `https://jmt-oss.oss-cn-beijing.aliyuncs.com/img/custom_made/myExamine/bg${bg_w}.png`
      item.icons = `https://jmt-oss.oss-cn-beijing.aliyuncs.com/img/home/icon${bg_w}.png`

    })
  },
}
</script>

<style lang="scss" scoped>
.addedItem{
  .item{
    display: flex;
    flex-direction: column;
    margin-bottom: 30rpx;
    border-radius: 20rpx;
    overflow: hidden;

    .title {
      height: 40rpx;
      line-height: 40rpx;
  
      width: 690rpx;
      height: 86rpx;
  
      background-repeat: no-repeat;
      // background-size: contain;
  
      .title_txt {
        display: flex;
        justify-content: space-between;
        align-items: center;
       height: 86rpx;
  
        padding: 0 30rpx;
        box-sizing: border-box;
      }
  
      .txt_box {
        display: flex;
        height: 40rpx;
  
        .icon {
          width: 36rpx;
          height: 36rpx;
          margin-right: 10rpx;
  
          img {
            width: 100%;
            height: 100%;
            vertical-align: middle;
          }
        }
  
        .txt {
          font-family: PingFang SC;
  
          font-weight: 700;
          font-size: 36rpx;
          display: flex;
          align-items: center;
  
          color: #fff;
        }
      }
  
      .date {
        color: #ffffff;
        font-family: PingFang SC;
        font-size: 24rpx;
        display: flex;
        align-items: center;
        font-weight: 400;
  
      }
    }
    .content{
      height: 280rpx;
      background: #fff;
      .item_box {
      padding: 30rpx;
      display: flex;
      position: relative;

      .img_box {
        width: 220rpx;
        height: 220rpx;
        margin-right: 30rpx;
        border-radius: 10rpx;
        overflow: hidden;
      }

      .r {
        display: flex;
        flex-direction: column;
        justify-content: space-between;

        .title {
          font-family: PingFang SC;
          font-weight: 700;
          font-size: 32rpx;
          width: 400rpx;
          color: #242424;

          text-overflow: -o-ellipsis-lastline;
          overflow: hidden;
          text-overflow: ellipsis;
          display: -webkit-box;
          -webkit-line-clamp: 2;
          line-clamp: 2;
          -webkit-box-orient: vertical;
        }

        .bottom {
          .now_price {
            color: #fb1821;
            display: flex;
            align-items: baseline;

            span {
              font-weight: bold;
              font-size: 28rpx;
            }

            .num {
              font-weight: bold;
              font-size: 40rpx;
            }

            .icon_img_box {
              margin-left: 9rpx;
              width: 74rpx;
              height: 25rpx;
            }
          }

          .market_price {
            font-family: PingFang SC;
            text-decoration-line: line-through;

            font-weight: 400;
            font-size: 20rpx;
            color: #999999;
          }
        }
      }

      .icon_plus {
        position: absolute;
        right: 30rpx;
        bottom: 26rpx;

        border-radius: 50%;
        color: #fb1821;

        font-size: 58rpx;
      }
    }
    }
  }
}
</style>
